/*
 * Network.h
 *
 *  Created on: Aug 24, 2010
 *      Author: Satish
 */

#ifndef NETWORK_H_
#define NETWORK_H_

#include"location.h"
#include<vector>
#include"path.h"

class Network
{
private:

	int mNoOfComputers; //no. of computers in the network

	vector<Location> mComputers;//locations of computers

	vector<Path> mPaths; //

	Path minpath;//contains the minimum path in the network and the length
                 //of cable required

	float mdistance[8][8];//distance matrix of the network

public:

	Network();//default constructor

	Network(int aNoOfComputers,vector<Location> aComputers)
	:mNoOfComputers(aNoOfComputers),mComputers(aComputers){}//constructor with member initialization

	void calculatedistances();//calculates distances between every pair of computers in the network

	void showcomputers(); //displays the locations of computers in the network

	void showdistances(); //shows the distance matrix in the given network

	void findoptimalpath();//finds the optimal path by going through all possible paths

	void showcablerequirements();//displays the cable requirements to connect computers in the optimal path

	void permutate(string str,int index);//helper function used to generate all possible paths in the network

	virtual ~Network();//Destructor

};

#endif /* NETWORK_H_ */
